/*
 *
 *    Copyright (c) 2022 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP
#include "CHIPCallbackTypes.h"

#include <controller/java/AndroidCallbacks.h>
#include <jni.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/JniReferences.h>
#include <zap-generated/CHIPClientCallbacks.h>

class CHIPBooleanAttributeCallback : public chip::Callback::Callback<BooleanAttributeCallback>
{
public:
    CHIPBooleanAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBooleanAttributeCallback();

    static void maybeDestroy(CHIPBooleanAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBooleanAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, bool value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBooleanAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPCharStringAttributeCallback : public chip::Callback::Callback<CharStringAttributeCallback>
{
public:
    CHIPCharStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPCharStringAttributeCallback();

    static void maybeDestroy(CHIPCharStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPCharStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::CharSpan value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPCharStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPDoubleAttributeCallback : public chip::Callback::Callback<DoubleAttributeCallback>
{
public:
    CHIPDoubleAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoubleAttributeCallback();

    static void maybeDestroy(CHIPDoubleAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoubleAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, double value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoubleAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPFloatAttributeCallback : public chip::Callback::Callback<FloatAttributeCallback>
{
public:
    CHIPFloatAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFloatAttributeCallback();

    static void maybeDestroy(CHIPFloatAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFloatAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, float value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFloatAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt8sAttributeCallback : public chip::Callback::Callback<Int8sAttributeCallback>
{
public:
    CHIPInt8sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt8sAttributeCallback();

    static void maybeDestroy(CHIPInt8sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt8sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, int8_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt8sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt8uAttributeCallback : public chip::Callback::Callback<Int8uAttributeCallback>
{
public:
    CHIPInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt8uAttributeCallback();

    static void maybeDestroy(CHIPInt8uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt8uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, uint8_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt8uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt16sAttributeCallback : public chip::Callback::Callback<Int16sAttributeCallback>
{
public:
    CHIPInt16sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt16sAttributeCallback();

    static void maybeDestroy(CHIPInt16sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt16sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, int16_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt16sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt16uAttributeCallback : public chip::Callback::Callback<Int16uAttributeCallback>
{
public:
    CHIPInt16uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt16uAttributeCallback();

    static void maybeDestroy(CHIPInt16uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt16uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, uint16_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt16uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt32sAttributeCallback : public chip::Callback::Callback<Int32sAttributeCallback>
{
public:
    CHIPInt32sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt32sAttributeCallback();

    static void maybeDestroy(CHIPInt32sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt32sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, int32_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt32sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt32uAttributeCallback : public chip::Callback::Callback<Int32uAttributeCallback>
{
public:
    CHIPInt32uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt32uAttributeCallback();

    static void maybeDestroy(CHIPInt32uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt32uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, uint32_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt32uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt64sAttributeCallback : public chip::Callback::Callback<Int64sAttributeCallback>
{
public:
    CHIPInt64sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt64sAttributeCallback();

    static void maybeDestroy(CHIPInt64sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt64sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, int64_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt64sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPInt64uAttributeCallback : public chip::Callback::Callback<Int64uAttributeCallback>
{
public:
    CHIPInt64uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPInt64uAttributeCallback();

    static void maybeDestroy(CHIPInt64uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPInt64uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, uint64_t value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPInt64uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
class CHIPOctetStringAttributeCallback : public chip::Callback::Callback<OctetStringAttributeCallback>
{
public:
    CHIPOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOctetStringAttributeCallback();

    static void maybeDestroy(CHIPOctetStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOctetStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::ByteSpan value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOctetStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccessControlAclAttributeCallback : public chip::Callback::Callback<CHIPAccessControlClusterAclAttributeCallbackType>
{
public:
    CHIPAccessControlAclAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccessControlAclAttributeCallback();

    static void maybeDestroy(CHIPAccessControlAclAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccessControlAclAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::AccessControl::Structs::AccessControlEntry::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccessControlAclAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccessControlExtensionAttributeCallback
    : public chip::Callback::Callback<CHIPAccessControlClusterExtensionAttributeCallbackType>
{
public:
    CHIPAccessControlExtensionAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccessControlExtensionAttributeCallback();

    static void maybeDestroy(CHIPAccessControlExtensionAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccessControlExtensionAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::AccessControl::Structs::ExtensionEntry::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccessControlExtensionAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccessControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAccessControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAccessControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccessControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAccessControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccessControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccessControlServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccessControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAccessControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAccessControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccessControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAccessControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccessControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccessControlClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccessControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPAccessControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPAccessControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccessControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPAccessControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccessControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccessControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccountLoginServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAccountLoginClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAccountLoginServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccountLoginServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAccountLoginServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccountLoginServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccountLoginServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccountLoginClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAccountLoginClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAccountLoginClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccountLoginClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAccountLoginClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccountLoginClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccountLoginClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAccountLoginAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPAccountLoginClusterAttributeListAttributeCallbackType>
{
public:
    CHIPAccountLoginAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAccountLoginAttributeListAttributeCallback();

    static void maybeDestroy(CHIPAccountLoginAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAccountLoginAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAccountLoginAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback
    : public chip::Callback::Callback<CHIPAdministratorCommissioningClusterAdminFabricIndexAttributeCallbackType>
{
public:
    CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback();

    static void maybeDestroy(CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, chip::FabricIndex value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAdministratorCommissioningClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAdministratorCommissioningServerGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAdministratorCommissioningClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAdministratorCommissioningClientGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAdministratorCommissioningAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPAdministratorCommissioningClusterAttributeListAttributeCallbackType>
{
public:
    CHIPAdministratorCommissioningAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAdministratorCommissioningAttributeListAttributeCallback();

    static void maybeDestroy(CHIPAdministratorCommissioningAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAdministratorCommissioningAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAdministratorCommissioningAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationBasicAllowedVendorListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationBasicClusterAllowedVendorListAttributeCallbackType>
{
public:
    CHIPApplicationBasicAllowedVendorListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationBasicAllowedVendorListAttributeCallback();

    static void maybeDestroy(CHIPApplicationBasicAllowedVendorListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationBasicAllowedVendorListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::VendorId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationBasicAllowedVendorListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationBasicServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationBasicClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPApplicationBasicServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationBasicServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPApplicationBasicServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationBasicServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationBasicServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationBasicClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationBasicClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPApplicationBasicClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationBasicClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPApplicationBasicClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationBasicClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationBasicClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationBasicAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationBasicClusterAttributeListAttributeCallbackType>
{
public:
    CHIPApplicationBasicAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationBasicAttributeListAttributeCallback();

    static void maybeDestroy(CHIPApplicationBasicAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationBasicAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationBasicAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationLauncherCatalogListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationLauncherClusterCatalogListAttributeCallbackType>
{
public:
    CHIPApplicationLauncherCatalogListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationLauncherCatalogListAttributeCallback();

    static void maybeDestroy(CHIPApplicationLauncherCatalogListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationLauncherCatalogListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint16_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationLauncherCatalogListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationLauncherClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationLauncherServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationLauncherClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationLauncherClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPApplicationLauncherAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPApplicationLauncherClusterAttributeListAttributeCallbackType>
{
public:
    CHIPApplicationLauncherAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPApplicationLauncherAttributeListAttributeCallback();

    static void maybeDestroy(CHIPApplicationLauncherAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPApplicationLauncherAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPApplicationLauncherAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAudioOutputOutputListAttributeCallback
    : public chip::Callback::Callback<CHIPAudioOutputClusterOutputListAttributeCallbackType>
{
public:
    CHIPAudioOutputOutputListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAudioOutputOutputListAttributeCallback();

    static void maybeDestroy(CHIPAudioOutputOutputListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAudioOutputOutputListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::AudioOutput::Structs::OutputInfo::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAudioOutputOutputListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAudioOutputServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAudioOutputClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAudioOutputServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAudioOutputServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAudioOutputServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAudioOutputServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAudioOutputServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAudioOutputClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPAudioOutputClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPAudioOutputClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAudioOutputClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPAudioOutputClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAudioOutputClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAudioOutputClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPAudioOutputAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPAudioOutputClusterAttributeListAttributeCallbackType>
{
public:
    CHIPAudioOutputAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPAudioOutputAttributeListAttributeCallback();

    static void maybeDestroy(CHIPAudioOutputAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPAudioOutputAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPAudioOutputAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBarrierControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBarrierControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBarrierControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBarrierControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBarrierControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBarrierControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBarrierControlServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBarrierControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBarrierControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBarrierControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBarrierControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBarrierControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBarrierControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBarrierControlClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBarrierControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBarrierControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBarrierControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBarrierControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBarrierControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBarrierControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBarrierControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBasicVendorIDAttributeCallback : public chip::Callback::Callback<CHIPBasicClusterVendorIDAttributeCallbackType>
{
public:
    CHIPBasicVendorIDAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBasicVendorIDAttributeCallback();

    static void maybeDestroy(CHIPBasicVendorIDAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBasicVendorIDAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, chip::VendorId value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBasicVendorIDAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBasicServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBasicClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBasicServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBasicServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBasicServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBasicServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBasicServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBasicClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBasicClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBasicClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBasicClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBasicClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBasicClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBasicClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBasicAttributeListAttributeCallback : public chip::Callback::Callback<CHIPBasicClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBasicAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBasicAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBasicAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBasicAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBasicAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBinaryInputBasicClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBinaryInputBasicServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBinaryInputBasicClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBinaryInputBasicClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBinaryInputBasicAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBinaryInputBasicClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBinaryInputBasicAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBinaryInputBasicAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBinaryInputBasicAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBinaryInputBasicAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBinaryInputBasicAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBindingBindingAttributeCallback : public chip::Callback::Callback<CHIPBindingClusterBindingAttributeCallbackType>
{
public:
    CHIPBindingBindingAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBindingBindingAttributeCallback();

    static void maybeDestroy(CHIPBindingBindingAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBindingBindingAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::Binding::Structs::TargetStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBindingBindingAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBindingServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBindingClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBindingServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBindingServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBindingServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBindingServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBindingServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBindingClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBindingClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBindingClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBindingClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBindingClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBindingClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBindingClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBindingAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBindingClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBindingAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBindingAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBindingAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBindingAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBindingAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBooleanStateServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBooleanStateClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBooleanStateServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBooleanStateServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBooleanStateServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBooleanStateServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBooleanStateServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBooleanStateClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBooleanStateClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBooleanStateClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBooleanStateClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBooleanStateClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBooleanStateClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBooleanStateClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBooleanStateAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBooleanStateClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBooleanStateAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBooleanStateAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBooleanStateAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBooleanStateAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBooleanStateAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedActionsActionListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedActionsClusterActionListAttributeCallbackType>
{
public:
    CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedActionsActionListAttributeCallback();

    static void maybeDestroy(CHIPBridgedActionsActionListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedActionsActionListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedActionsActionListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedActionsEndpointListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedActionsClusterEndpointListAttributeCallbackType>
{
public:
    CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedActionsEndpointListAttributeCallback();

    static void maybeDestroy(CHIPBridgedActionsEndpointListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedActionsEndpointListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::BridgedActions::Structs::EndpointListStruct::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedActionsEndpointListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedActionsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedActionsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBridgedActionsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedActionsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBridgedActionsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedActionsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedActionsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedActionsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedActionsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBridgedActionsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedActionsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBridgedActionsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedActionsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedActionsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedActionsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedActionsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBridgedActionsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedActionsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBridgedActionsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedActionsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedActionsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedDeviceBasicVendorIDAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedDeviceBasicClusterVendorIDAttributeCallbackType>
{
public:
    CHIPBridgedDeviceBasicVendorIDAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedDeviceBasicVendorIDAttributeCallback();

    static void maybeDestroy(CHIPBridgedDeviceBasicVendorIDAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedDeviceBasicVendorIDAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, chip::VendorId value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedDeviceBasicVendorIDAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedDeviceBasicClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedDeviceBasicServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedDeviceBasicClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedDeviceBasicClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPBridgedDeviceBasicAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPBridgedDeviceBasicClusterAttributeListAttributeCallbackType>
{
public:
    CHIPBridgedDeviceBasicAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPBridgedDeviceBasicAttributeListAttributeCallback();

    static void maybeDestroy(CHIPBridgedDeviceBasicAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPBridgedDeviceBasicAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPBridgedDeviceBasicAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPChannelChannelListAttributeCallback : public chip::Callback::Callback<CHIPChannelClusterChannelListAttributeCallbackType>
{
public:
    CHIPChannelChannelListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPChannelChannelListAttributeCallback();

    static void maybeDestroy(CHIPChannelChannelListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPChannelChannelListAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::DecodableList<chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPChannelChannelListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPChannelServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPChannelClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPChannelServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPChannelServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPChannelServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPChannelServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPChannelServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPChannelClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPChannelClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPChannelClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPChannelClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPChannelClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPChannelClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPChannelClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPChannelAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPChannelClusterAttributeListAttributeCallbackType>
{
public:
    CHIPChannelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPChannelAttributeListAttributeCallback();

    static void maybeDestroy(CHIPChannelAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPChannelAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPChannelAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPColorControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPColorControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPColorControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPColorControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPColorControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPColorControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPColorControlServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPColorControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPColorControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPColorControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPColorControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPColorControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPColorControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPColorControlClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPColorControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPColorControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPColorControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPColorControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPColorControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPColorControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPColorControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPContentLauncherAcceptHeaderAttributeCallback
    : public chip::Callback::Callback<CHIPContentLauncherClusterAcceptHeaderAttributeCallbackType>
{
public:
    CHIPContentLauncherAcceptHeaderAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPContentLauncherAcceptHeaderAttributeCallback();

    static void maybeDestroy(CHIPContentLauncherAcceptHeaderAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPContentLauncherAcceptHeaderAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CharSpan> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPContentLauncherAcceptHeaderAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPContentLauncherServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPContentLauncherClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPContentLauncherServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPContentLauncherServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPContentLauncherServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPContentLauncherServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPContentLauncherServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPContentLauncherClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPContentLauncherClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPContentLauncherClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPContentLauncherClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPContentLauncherClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPContentLauncherClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPContentLauncherClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPContentLauncherAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPContentLauncherClusterAttributeListAttributeCallbackType>
{
public:
    CHIPContentLauncherAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPContentLauncherAttributeListAttributeCallback();

    static void maybeDestroy(CHIPContentLauncherAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPContentLauncherAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPContentLauncherAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorDeviceListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterDeviceListAttributeCallbackType>
{
public:
    CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorDeviceListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorDeviceListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorDeviceListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::Descriptor::Structs::DeviceType::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorDeviceListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorServerListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterServerListAttributeCallbackType>
{
public:
    CHIPDescriptorServerListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorServerListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorServerListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorServerListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::ClusterId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorServerListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorClientListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterClientListAttributeCallbackType>
{
public:
    CHIPDescriptorClientListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorClientListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorClientListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorClientListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::ClusterId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorClientListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorPartsListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterPartsListAttributeCallbackType>
{
public:
    CHIPDescriptorPartsListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorPartsListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorPartsListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorPartsListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::EndpointId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorPartsListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDescriptorServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDescriptorClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDescriptorAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPDescriptorClusterAttributeListAttributeCallbackType>
{
public:
    CHIPDescriptorAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDescriptorAttributeListAttributeCallback();

    static void maybeDestroy(CHIPDescriptorAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDescriptorAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDescriptorAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDiagnosticLogsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDiagnosticLogsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDiagnosticLogsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDiagnosticLogsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDiagnosticLogsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPDiagnosticLogsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPDiagnosticLogsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDiagnosticLogsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPDiagnosticLogsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDiagnosticLogsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDiagnosticLogsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDoorLockLockStateAttributeCallback : public chip::Callback::Callback<CHIPDoorLockClusterLockStateAttributeCallbackType>
{
public:
    CHIPDoorLockLockStateAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoorLockLockStateAttributeCallback();

    static void maybeDestroy(CHIPDoorLockLockStateAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoorLockLockStateAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DlLockState> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoorLockLockStateAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDoorLockDoorStateAttributeCallback : public chip::Callback::Callback<CHIPDoorLockClusterDoorStateAttributeCallbackType>
{
public:
    CHIPDoorLockDoorStateAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoorLockDoorStateAttributeCallback();

    static void maybeDestroy(CHIPDoorLockDoorStateAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoorLockDoorStateAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DlDoorState> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoorLockDoorStateAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDoorLockServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDoorLockClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDoorLockServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoorLockServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDoorLockServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoorLockServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoorLockServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDoorLockClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPDoorLockClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPDoorLockClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoorLockClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPDoorLockClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoorLockClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoorLockClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPDoorLockAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPDoorLockClusterAttributeListAttributeCallbackType>
{
public:
    CHIPDoorLockAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPDoorLockAttributeListAttributeCallback();

    static void maybeDestroy(CHIPDoorLockAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPDoorLockAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPDoorLockAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPElectricalMeasurementClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPElectricalMeasurementServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPElectricalMeasurementClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPElectricalMeasurementClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPElectricalMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPElectricalMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPElectricalMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPElectricalMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPElectricalMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPElectricalMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPElectricalMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterPHYRateAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::app::Clusters::EthernetNetworkDiagnostics::PHYRateType> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsPHYRateAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterFullDuplexAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<bool> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsFullDuplexAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterCarrierDetectAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<bool> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsServerGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsClientGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPEthernetNetworkDiagnosticsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFanControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFanControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFanControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFanControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFanControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFanControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFanControlServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFanControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFanControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFanControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFanControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFanControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFanControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFanControlClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFanControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPFanControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPFanControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFanControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPFanControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFanControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFanControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFixedLabelLabelListAttributeCallback
    : public chip::Callback::Callback<CHIPFixedLabelClusterLabelListAttributeCallbackType>
{
public:
    CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFixedLabelLabelListAttributeCallback();

    static void maybeDestroy(CHIPFixedLabelLabelListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFixedLabelLabelListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFixedLabelLabelListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFixedLabelServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFixedLabelClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFixedLabelServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFixedLabelServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFixedLabelServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFixedLabelServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFixedLabelServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFixedLabelClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFixedLabelClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFixedLabelClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFixedLabelClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFixedLabelClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFixedLabelClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFixedLabelClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFixedLabelAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPFixedLabelClusterAttributeListAttributeCallbackType>
{
public:
    CHIPFixedLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFixedLabelAttributeListAttributeCallback();

    static void maybeDestroy(CHIPFixedLabelAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFixedLabelAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFixedLabelAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterMeasuredValueAttributeCallbackType>
{
public:
    CHIPFlowMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementMinMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterMinMeasuredValueAttributeCallbackType>
{
public:
    CHIPFlowMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementMinMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementMinMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementMinMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementMinMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementMaxMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterMaxMeasuredValueAttributeCallbackType>
{
public:
    CHIPFlowMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementMaxMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementMaxMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementMaxMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementMaxMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPFlowMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPFlowMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPFlowMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPFlowMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPFlowMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPFlowMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPFlowMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralCommissioningClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralCommissioningServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralCommissioningClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralCommissioningClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralCommissioningAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralCommissioningClusterAttributeListAttributeCallbackType>
{
public:
    CHIPGeneralCommissioningAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralCommissioningAttributeListAttributeCallback();

    static void maybeDestroy(CHIPGeneralCommissioningAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralCommissioningAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralCommissioningAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterNetworkInterfacesAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterActiveHardwareFaultsAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterActiveRadioFaultsAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterActiveNetworkFaultsAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGeneralDiagnosticsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPGeneralDiagnosticsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPGeneralDiagnosticsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGeneralDiagnosticsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPGeneralDiagnosticsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGeneralDiagnosticsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGeneralDiagnosticsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupKeyManagementGroupKeyMapAttributeCallback
    : public chip::Callback::Callback<CHIPGroupKeyManagementClusterGroupKeyMapAttributeCallbackType>
{
public:
    CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupKeyManagementGroupKeyMapAttributeCallback();

    static void maybeDestroy(CHIPGroupKeyManagementGroupKeyMapAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupKeyManagementGroupKeyMapAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupKeyManagementGroupKeyMapAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupKeyManagementGroupTableAttributeCallback
    : public chip::Callback::Callback<CHIPGroupKeyManagementClusterGroupTableAttributeCallbackType>
{
public:
    CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupKeyManagementGroupTableAttributeCallback();

    static void maybeDestroy(CHIPGroupKeyManagementGroupTableAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupKeyManagementGroupTableAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupKeyManagementGroupTableAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupKeyManagementClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupKeyManagementServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupKeyManagementClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupKeyManagementClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupKeyManagementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupKeyManagementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPGroupKeyManagementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupKeyManagementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPGroupKeyManagementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupKeyManagementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupKeyManagementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGroupsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGroupsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPGroupsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPGroupsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPGroupsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPGroupsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPGroupsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPGroupsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPGroupsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPGroupsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPGroupsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIdentifyServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPIdentifyClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPIdentifyServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIdentifyServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPIdentifyServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIdentifyServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIdentifyServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIdentifyClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPIdentifyClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPIdentifyClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIdentifyClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPIdentifyClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIdentifyClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIdentifyClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIdentifyAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPIdentifyClusterAttributeListAttributeCallbackType>
{
public:
    CHIPIdentifyAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIdentifyAttributeListAttributeCallback();

    static void maybeDestroy(CHIPIdentifyAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIdentifyAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIdentifyAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterMeasuredValueAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterMinMeasuredValueAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterMaxMeasuredValueAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPIlluminanceMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPIlluminanceMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPIlluminanceMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPIlluminanceMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPIlluminanceMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPIlluminanceMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPIlluminanceMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPKeypadInputServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPKeypadInputClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPKeypadInputServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPKeypadInputServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPKeypadInputServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPKeypadInputServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPKeypadInputServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPKeypadInputClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPKeypadInputClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPKeypadInputClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPKeypadInputClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPKeypadInputClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPKeypadInputClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPKeypadInputClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPKeypadInputAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPKeypadInputClusterAttributeListAttributeCallbackType>
{
public:
    CHIPKeypadInputAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPKeypadInputAttributeListAttributeCallback();

    static void maybeDestroy(CHIPKeypadInputAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPKeypadInputAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPKeypadInputAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlOnLevelAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterOnLevelAttributeCallbackType>
{
public:
    CHIPLevelControlOnLevelAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlOnLevelAttributeCallback();

    static void maybeDestroy(CHIPLevelControlOnLevelAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlOnLevelAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlOnLevelAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlOnTransitionTimeAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterOnTransitionTimeAttributeCallbackType>
{
public:
    CHIPLevelControlOnTransitionTimeAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlOnTransitionTimeAttributeCallback();

    static void maybeDestroy(CHIPLevelControlOnTransitionTimeAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlOnTransitionTimeAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlOnTransitionTimeAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlOffTransitionTimeAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterOffTransitionTimeAttributeCallbackType>
{
public:
    CHIPLevelControlOffTransitionTimeAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlOffTransitionTimeAttributeCallback();

    static void maybeDestroy(CHIPLevelControlOffTransitionTimeAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlOffTransitionTimeAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlOffTransitionTimeAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlDefaultMoveRateAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterDefaultMoveRateAttributeCallbackType>
{
public:
    CHIPLevelControlDefaultMoveRateAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlDefaultMoveRateAttributeCallback();

    static void maybeDestroy(CHIPLevelControlDefaultMoveRateAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlDefaultMoveRateAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlDefaultMoveRateAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlStartUpCurrentLevelAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterStartUpCurrentLevelAttributeCallbackType>
{
public:
    CHIPLevelControlStartUpCurrentLevelAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlStartUpCurrentLevelAttributeCallback();

    static void maybeDestroy(CHIPLevelControlStartUpCurrentLevelAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlStartUpCurrentLevelAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlStartUpCurrentLevelAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLevelControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLevelControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLevelControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLevelControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLevelControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPLevelControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPLevelControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLevelControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPLevelControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLevelControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLevelControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLocalizationConfigurationSupportedLocalesAttributeCallback
    : public chip::Callback::Callback<CHIPLocalizationConfigurationClusterSupportedLocalesAttributeCallbackType>
{
public:
    CHIPLocalizationConfigurationSupportedLocalesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLocalizationConfigurationSupportedLocalesAttributeCallback();

    static void maybeDestroy(CHIPLocalizationConfigurationSupportedLocalesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLocalizationConfigurationSupportedLocalesAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CharSpan> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLocalizationConfigurationSupportedLocalesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLocalizationConfigurationClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLocalizationConfigurationClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLowPowerServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLowPowerClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLowPowerServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLowPowerServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLowPowerServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLowPowerServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLowPowerServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLowPowerClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPLowPowerClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPLowPowerClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLowPowerClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPLowPowerClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLowPowerClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLowPowerClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPLowPowerAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPLowPowerClusterAttributeListAttributeCallbackType>
{
public:
    CHIPLowPowerAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPLowPowerAttributeListAttributeCallback();

    static void maybeDestroy(CHIPLowPowerAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPLowPowerAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPLowPowerAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaInputInputListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaInputClusterInputListAttributeCallbackType>
{
public:
    CHIPMediaInputInputListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaInputInputListAttributeCallback();

    static void maybeDestroy(CHIPMediaInputInputListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaInputInputListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::MediaInput::Structs::InputInfo::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaInputInputListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaInputServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaInputClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPMediaInputServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaInputServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPMediaInputServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaInputServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaInputServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaInputClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaInputClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPMediaInputClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaInputClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPMediaInputClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaInputClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaInputClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaInputAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaInputClusterAttributeListAttributeCallbackType>
{
public:
    CHIPMediaInputAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaInputAttributeListAttributeCallback();

    static void maybeDestroy(CHIPMediaInputAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaInputAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaInputAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackStartTimeAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterStartTimeAttributeCallbackType>
{
public:
    CHIPMediaPlaybackStartTimeAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackStartTimeAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackStartTimeAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackStartTimeAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackStartTimeAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackDurationAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterDurationAttributeCallbackType>
{
public:
    CHIPMediaPlaybackDurationAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackDurationAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackDurationAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackDurationAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackDurationAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackSeekRangeEndAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterSeekRangeEndAttributeCallbackType>
{
public:
    CHIPMediaPlaybackSeekRangeEndAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackSeekRangeEndAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackSeekRangeEndAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackSeekRangeEndAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackSeekRangeEndAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackSeekRangeStartAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterSeekRangeStartAttributeCallbackType>
{
public:
    CHIPMediaPlaybackSeekRangeStartAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackSeekRangeStartAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackSeekRangeStartAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackSeekRangeStartAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackSeekRangeStartAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPMediaPlaybackAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPMediaPlaybackClusterAttributeListAttributeCallbackType>
{
public:
    CHIPMediaPlaybackAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPMediaPlaybackAttributeListAttributeCallback();

    static void maybeDestroy(CHIPMediaPlaybackAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPMediaPlaybackAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPMediaPlaybackAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPModeSelectSupportedModesAttributeCallback
    : public chip::Callback::Callback<CHIPModeSelectClusterSupportedModesAttributeCallbackType>
{
public:
    CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPModeSelectSupportedModesAttributeCallback();

    static void maybeDestroy(CHIPModeSelectSupportedModesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPModeSelectSupportedModesAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPModeSelectSupportedModesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPModeSelectServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPModeSelectClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPModeSelectServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPModeSelectServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPModeSelectServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPModeSelectServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPModeSelectServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPModeSelectClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPModeSelectClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPModeSelectClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPModeSelectClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPModeSelectClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPModeSelectClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPModeSelectClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPModeSelectAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPModeSelectClusterAttributeListAttributeCallbackType>
{
public:
    CHIPModeSelectAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPModeSelectAttributeListAttributeCallback();

    static void maybeDestroy(CHIPModeSelectAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPModeSelectAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPModeSelectAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningNetworksAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterNetworksAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningNetworksAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningNetworksAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningNetworksAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningNetworksAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::NetworkCommissioning::Structs::NetworkInfo::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningNetworksAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterLastNetworkingStatusAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningLastNetworkingStatusAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningLastNetworkIDAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterLastNetworkIDAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningLastNetworkIDAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningLastNetworkIDAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningLastNetworkIDAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningLastNetworkIDAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::ByteSpan> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningLastNetworkIDAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterLastConnectErrorValueAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningLastConnectErrorValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPNetworkCommissioningClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPNetworkCommissioningClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPOtaSoftwareUpdateProviderClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback
    : public chip::Callback::Callback<CHIPOtaSoftwareUpdateRequestorClusterDefaultOtaProvidersAttributeCallbackType>
{
public:
    CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback();

    static void maybeDestroy(CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback
    : public chip::Callback::Callback<CHIPOtaSoftwareUpdateRequestorClusterUpdateStateProgressAttributeCallbackType>
{
public:
    CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback();

    static void maybeDestroy(CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPOtaSoftwareUpdateRequestorClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOccupancySensingServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOccupancySensingClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOccupancySensingServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOccupancySensingServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOccupancySensingServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOccupancySensingServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOccupancySensingServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOccupancySensingClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOccupancySensingClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOccupancySensingClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOccupancySensingClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOccupancySensingClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOccupancySensingClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOccupancySensingClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOccupancySensingAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPOccupancySensingClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOccupancySensingAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOccupancySensingAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOccupancySensingAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOccupancySensingAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOccupancySensingAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOnOffClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOnOffServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOnOffServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOnOffClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOnOffClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOnOffClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffAttributeListAttributeCallback : public chip::Callback::Callback<CHIPOnOffClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOnOffAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOnOffAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOnOffSwitchConfigurationClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffSwitchConfigurationServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOnOffSwitchConfigurationClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffSwitchConfigurationClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOnOffSwitchConfigurationAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPOnOffSwitchConfigurationClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOnOffSwitchConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOnOffSwitchConfigurationAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOnOffSwitchConfigurationAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOnOffSwitchConfigurationAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOnOffSwitchConfigurationAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsNOCsAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterNOCsAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsNOCsAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsNOCsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsNOCsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsNOCsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsFabricsAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterFabricsAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsFabricsAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsFabricsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsFabricsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsFabricsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterTrustedRootCertificatesAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::ByteSpan> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterCurrentFabricIndexAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, chip::FabricIndex value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPOperationalCredentialsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPOperationalCredentialsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPOperationalCredentialsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPOperationalCredentialsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPOperationalCredentialsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPOperationalCredentialsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPOperationalCredentialsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceActiveBatteryFaultsAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceClusterActiveBatteryFaultsAttributeCallbackType>
{
public:
    CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceActiveBatteryFaultsAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceActiveBatteryFaultsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceActiveBatteryFaultsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceActiveBatteryFaultsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPowerSourceServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPowerSourceClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceClusterAttributeListAttributeCallbackType>
{
public:
    CHIPPowerSourceAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceAttributeListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceConfigurationSourcesAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceConfigurationClusterSourcesAttributeCallbackType>
{
public:
    CHIPPowerSourceConfigurationSourcesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceConfigurationSourcesAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceConfigurationSourcesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceConfigurationSourcesAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceConfigurationSourcesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceConfigurationClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceConfigurationServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceConfigurationClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceConfigurationClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPowerSourceConfigurationAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPPowerSourceConfigurationClusterAttributeListAttributeCallbackType>
{
public:
    CHIPPowerSourceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPowerSourceConfigurationAttributeListAttributeCallback();

    static void maybeDestroy(CHIPPowerSourceConfigurationAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPowerSourceConfigurationAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPowerSourceConfigurationAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPressureMeasurementMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPPressureMeasurementClusterMeasuredValueAttributeCallbackType>
{
public:
    CHIPPressureMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPressureMeasurementMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPPressureMeasurementMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPressureMeasurementMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPressureMeasurementMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPressureMeasurementMinMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPPressureMeasurementClusterMinMeasuredValueAttributeCallbackType>
{
public:
    CHIPPressureMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPressureMeasurementMinMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPPressureMeasurementMinMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPressureMeasurementMinMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPressureMeasurementMinMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPressureMeasurementMaxMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPPressureMeasurementClusterMaxMeasuredValueAttributeCallbackType>
{
public:
    CHIPPressureMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPressureMeasurementMaxMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPPressureMeasurementMaxMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPressureMeasurementMaxMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPressureMeasurementMaxMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPressureMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPPressureMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPPressureMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPressureMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPPressureMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPressureMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPressureMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback
    : public chip::Callback::Callback<CHIPPumpConfigurationAndControlClusterLifetimeRunningHoursAttributeCallbackType>
{
public:
    CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback();

    static void maybeDestroy(CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback
    : public chip::Callback::Callback<CHIPPumpConfigurationAndControlClusterLifetimeEnergyConsumedAttributeCallbackType>
{
public:
    CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback();

    static void maybeDestroy(CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPumpConfigurationAndControlClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPumpConfigurationAndControlServerGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPPumpConfigurationAndControlClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPumpConfigurationAndControlClientGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPPumpConfigurationAndControlAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPPumpConfigurationAndControlClusterAttributeListAttributeCallbackType>
{
public:
    CHIPPumpConfigurationAndControlAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPPumpConfigurationAndControlAttributeListAttributeCallback();

    static void maybeDestroy(CHIPPumpConfigurationAndControlAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPPumpConfigurationAndControlAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPPumpConfigurationAndControlAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPRelativeHumidityMeasurementClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPRelativeHumidityMeasurementServerGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPRelativeHumidityMeasurementClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPRelativeHumidityMeasurementClientGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPRelativeHumidityMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPRelativeHumidityMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPRelativeHumidityMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPRelativeHumidityMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPRelativeHumidityMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPRelativeHumidityMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPRelativeHumidityMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPScenesServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPScenesClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPScenesServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPScenesServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPScenesServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPScenesServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPScenesServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPScenesClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPScenesClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPScenesClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPScenesClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPScenesClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPScenesClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPScenesClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPScenesAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPScenesClusterAttributeListAttributeCallbackType>
{
public:
    CHIPScenesAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPScenesAttributeListAttributeCallback();

    static void maybeDestroy(CHIPScenesAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPScenesAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPScenesAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback
    : public chip::Callback::Callback<CHIPSoftwareDiagnosticsClusterThreadMetricsAttributeCallbackType>
{
public:
    CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback();

    static void maybeDestroy(CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::SoftwareDiagnostics::Structs::ThreadMetrics::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPSoftwareDiagnosticsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSoftwareDiagnosticsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPSoftwareDiagnosticsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSoftwareDiagnosticsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSoftwareDiagnosticsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPSoftwareDiagnosticsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPSoftwareDiagnosticsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSoftwareDiagnosticsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPSoftwareDiagnosticsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSoftwareDiagnosticsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSoftwareDiagnosticsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSwitchServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPSwitchClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPSwitchServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSwitchServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPSwitchServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSwitchServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSwitchServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSwitchClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPSwitchClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPSwitchClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSwitchClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPSwitchClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSwitchClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSwitchClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPSwitchAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPSwitchClusterAttributeListAttributeCallbackType>
{
public:
    CHIPSwitchAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPSwitchAttributeListAttributeCallback();

    static void maybeDestroy(CHIPSwitchAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPSwitchAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPSwitchAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTargetNavigatorTargetListAttributeCallback
    : public chip::Callback::Callback<CHIPTargetNavigatorClusterTargetListAttributeCallbackType>
{
public:
    CHIPTargetNavigatorTargetListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTargetNavigatorTargetListAttributeCallback();

    static void maybeDestroy(CHIPTargetNavigatorTargetListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTargetNavigatorTargetListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTargetNavigatorTargetListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTargetNavigatorClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTargetNavigatorServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTargetNavigatorClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTargetNavigatorClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTargetNavigatorAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPTargetNavigatorClusterAttributeListAttributeCallbackType>
{
public:
    CHIPTargetNavigatorAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTargetNavigatorAttributeListAttributeCallback();

    static void maybeDestroy(CHIPTargetNavigatorAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTargetNavigatorAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTargetNavigatorAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTemperatureMeasurementMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPTemperatureMeasurementClusterMeasuredValueAttributeCallbackType>
{
public:
    CHIPTemperatureMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTemperatureMeasurementMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPTemperatureMeasurementMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTemperatureMeasurementMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTemperatureMeasurementMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPTemperatureMeasurementClusterMinMeasuredValueAttributeCallbackType>
{
public:
    CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTemperatureMeasurementMinMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback
    : public chip::Callback::Callback<CHIPTemperatureMeasurementClusterMaxMeasuredValueAttributeCallbackType>
{
public:
    CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback();

    static void maybeDestroy(CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTemperatureMeasurementMaxMeasuredValueAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTemperatureMeasurementAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPTemperatureMeasurementClusterAttributeListAttributeCallbackType>
{
public:
    CHIPTemperatureMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTemperatureMeasurementAttributeListAttributeCallback();

    static void maybeDestroy(CHIPTemperatureMeasurementAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTemperatureMeasurementAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTemperatureMeasurementAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListInt8uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListInt8uAttributeCallbackType>
{
public:
    CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListInt8uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListInt8uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListInt8uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<uint8_t> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListInt8uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListOctetStringAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListOctetStringAttributeCallbackType>
{
public:
    CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListOctetStringAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListOctetStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListOctetStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::ByteSpan> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListOctetStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListStructOctetStringAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListStructOctetStringAttributeCallbackType>
{
public:
    CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListStructOctetStringAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListStructOctetStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListStructOctetStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::TestCluster::Structs::TestListStructOctet::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListStructOctetStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterVendorIdAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterVendorIdAttributeCallbackType>
{
public:
    CHIPTestClusterVendorIdAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterVendorIdAttributeCallback();

    static void maybeDestroy(CHIPTestClusterVendorIdAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterVendorIdAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, chip::VendorId value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterVendorIdAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListNullablesAndOptionalsStructAttributeCallbackType>
{
public:
    CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListLongOctetStringAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListLongOctetStringAttributeCallbackType>
{
public:
    CHIPTestClusterListLongOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListLongOctetStringAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListLongOctetStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListLongOctetStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::ByteSpan> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListLongOctetStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterListFabricScopedAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterListFabricScopedAttributeCallbackType>
{
public:
    CHIPTestClusterListFabricScopedAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterListFabricScopedAttributeCallback();

    static void maybeDestroy(CHIPTestClusterListFabricScopedAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterListFabricScopedAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::TestCluster::Structs::TestFabricScoped::DecodableType> &
            list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterListFabricScopedAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableBooleanAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableBooleanAttributeCallbackType>
{
public:
    CHIPTestClusterNullableBooleanAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableBooleanAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableBooleanAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableBooleanAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<bool> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableBooleanAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableBitmap8AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableBitmap8AttributeCallbackType>
{
public:
    CHIPTestClusterNullableBitmap8AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableBitmap8AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableBitmap8AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableBitmap8AttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::BitFlags<chip::app::Clusters::TestCluster::Bitmap8MaskMap>> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableBitmap8AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableBitmap16AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableBitmap16AttributeCallbackType>
{
public:
    CHIPTestClusterNullableBitmap16AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableBitmap16AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableBitmap16AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableBitmap16AttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::BitFlags<chip::app::Clusters::TestCluster::Bitmap16MaskMap>> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableBitmap16AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableBitmap32AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableBitmap32AttributeCallbackType>
{
public:
    CHIPTestClusterNullableBitmap32AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableBitmap32AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableBitmap32AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableBitmap32AttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::BitFlags<chip::app::Clusters::TestCluster::Bitmap32MaskMap>> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableBitmap32AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableBitmap64AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableBitmap64AttributeCallbackType>
{
public:
    CHIPTestClusterNullableBitmap64AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableBitmap64AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableBitmap64AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableBitmap64AttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::BitFlags<chip::app::Clusters::TestCluster::Bitmap64MaskMap>> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableBitmap64AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt8uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt8uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt8uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt8uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt8uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt8uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt16uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt16uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt16uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt16uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt16uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt16uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt16uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt24uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt24uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt24uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt24uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt24uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt24uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt24uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt32uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt32uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt32uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt32uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt32uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt32uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt32uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt40uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt40uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt40uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt40uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt40uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt40uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt40uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt48uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt48uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt48uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt48uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt48uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt48uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt48uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt56uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt56uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt56uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt56uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt56uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt56uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt56uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt64uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt64uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt64uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt64uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt64uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt64uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt64uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt8sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt8sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt8sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt8sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt8sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt8sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt8sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt16sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt16sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt16sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt16sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt16sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt16sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt16sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt24sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt24sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt24sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt24sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt24sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt24sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt24sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt32sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt32sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt32sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt32sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt32sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt32sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int32_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt32sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt40sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt40sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt40sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt40sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt40sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt40sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt40sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt48sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt48sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt48sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt48sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt48sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt48sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt48sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt56sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt56sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt56sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt56sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt56sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt56sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt56sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableInt64sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableInt64sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableInt64sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableInt64sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableInt64sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableInt64sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int64_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableInt64sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableEnum8AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableEnum8AttributeCallbackType>
{
public:
    CHIPTestClusterNullableEnum8AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableEnum8AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableEnum8AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableEnum8AttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableEnum8AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableEnum16AttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableEnum16AttributeCallbackType>
{
public:
    CHIPTestClusterNullableEnum16AttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableEnum16AttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableEnum16AttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableEnum16AttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableEnum16AttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableFloatSingleAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableFloatSingleAttributeCallbackType>
{
public:
    CHIPTestClusterNullableFloatSingleAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableFloatSingleAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableFloatSingleAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableFloatSingleAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<float> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableFloatSingleAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableFloatDoubleAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableFloatDoubleAttributeCallbackType>
{
public:
    CHIPTestClusterNullableFloatDoubleAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableFloatDoubleAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableFloatDoubleAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableFloatDoubleAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<double> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableFloatDoubleAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableOctetStringAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableOctetStringAttributeCallbackType>
{
public:
    CHIPTestClusterNullableOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableOctetStringAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableOctetStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableOctetStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::ByteSpan> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableOctetStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableCharStringAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableCharStringAttributeCallbackType>
{
public:
    CHIPTestClusterNullableCharStringAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableCharStringAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableCharStringAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableCharStringAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::CharSpan> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableCharStringAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableEnumAttrAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableEnumAttrAttributeCallbackType>
{
public:
    CHIPTestClusterNullableEnumAttrAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableEnumAttrAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableEnumAttrAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableEnumAttrAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::Nullable<chip::app::Clusters::TestCluster::SimpleEnum> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableEnumAttrAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableRangeRestrictedInt8uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableRangeRestrictedInt8sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableRangeRestrictedInt16uAttributeCallbackType>
{
public:
    CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterNullableRangeRestrictedInt16sAttributeCallbackType>
{
public:
    CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback();

    static void maybeDestroy(CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTestClusterServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTestClusterServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTestClusterClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTestClusterClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTestClusterAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPTestClusterClusterAttributeListAttributeCallbackType>
{
public:
    CHIPTestClusterAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTestClusterAttributeListAttributeCallback();

    static void maybeDestroy(CHIPTestClusterAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTestClusterAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTestClusterAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThermostatAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPThermostatClusterAttributeListAttributeCallbackType>
{
public:
    CHIPThermostatAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThermostatAttributeListAttributeCallback();

    static void maybeDestroy(CHIPThermostatAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThermostatAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThermostatAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<
          CHIPThermostatUserInterfaceConfigurationClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback(jobject javaCallback,
                                                                                        bool keepAlive = false);

    ~CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThermostatUserInterfaceConfigurationServerGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<
          CHIPThermostatUserInterfaceConfigurationClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback(jobject javaCallback,
                                                                                        bool keepAlive = false);

    ~CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThermostatUserInterfaceConfigurationClientGeneratedCommandListAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPThermostatUserInterfaceConfigurationClusterAttributeListAttributeCallbackType>
{
public:
    CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback();

    static void maybeDestroy(CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterNeighborTableListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterRouteTableListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterSecurityPolicyAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::DecodableList<
                               chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponentsAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::DecodableList<
                   chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback *>(context)
                ->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterActiveNetworkFaultsListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::DecodableList<chip::app::Clusters::ThreadNetworkDiagnostics::NetworkFault> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPThreadNetworkDiagnosticsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback
    : public chip::Callback::Callback<CHIPTimeFormatLocalizationClusterSupportedCalendarTypesAttributeCallbackType>
{
public:
    CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback();

    static void maybeDestroy(CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::DecodableList<chip::app::Clusters::TimeFormatLocalization::CalendarType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTimeFormatLocalizationClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTimeFormatLocalizationServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPTimeFormatLocalizationClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPTimeFormatLocalizationClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPUnitLocalizationAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPUnitLocalizationClusterAttributeListAttributeCallbackType>
{
public:
    CHIPUnitLocalizationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPUnitLocalizationAttributeListAttributeCallback();

    static void maybeDestroy(CHIPUnitLocalizationAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPUnitLocalizationAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPUnitLocalizationAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPUserLabelLabelListAttributeCallback : public chip::Callback::Callback<CHIPUserLabelClusterLabelListAttributeCallbackType>
{
public:
    CHIPUserLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPUserLabelLabelListAttributeCallback();

    static void maybeDestroy(CHIPUserLabelLabelListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPUserLabelLabelListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(
        void * context,
        const chip::app::DataModel::DecodableList<chip::app::Clusters::UserLabel::Structs::LabelStruct::DecodableType> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPUserLabelLabelListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPUserLabelServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPUserLabelClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPUserLabelServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPUserLabelServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPUserLabelServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPUserLabelServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPUserLabelServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPUserLabelClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPUserLabelClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPUserLabelClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPUserLabelClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPUserLabelClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPUserLabelClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPUserLabelClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWakeOnLanServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWakeOnLanClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWakeOnLanServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWakeOnLanServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWakeOnLanServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWakeOnLanServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWakeOnLanServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWakeOnLanClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWakeOnLanClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWakeOnLanClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWakeOnLanClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWakeOnLanClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWakeOnLanClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWakeOnLanClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWakeOnLanAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPWakeOnLanClusterAttributeListAttributeCallbackType>
{
public:
    CHIPWakeOnLanAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWakeOnLanAttributeListAttributeCallback();

    static void maybeDestroy(CHIPWakeOnLanAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWakeOnLanAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWakeOnLanAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsBssidAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterBssidAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsBssidAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsBssidAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsBssidAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsBssidAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::ByteSpan> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsBssidAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterSecurityTypeAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context,
                           const chip::app::DataModel::Nullable<chip::app::Clusters::WiFiNetworkDiagnostics::SecurityType> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsSecurityTypeAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterWiFiVersionAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback>(callback);
        }
    }

    static void
    CallbackFn(void * context,
               const chip::app::DataModel::Nullable<chip::app::Clusters::WiFiNetworkDiagnostics::WiFiVersionType> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsWiFiVersionAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterChannelNumberAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsChannelNumberAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsRssiAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterRssiAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsRssiAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsRssiAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsRssiAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsRssiAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<int8_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsRssiAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPWiFiNetworkDiagnosticsClusterAttributeListAttributeCallbackType>
{
public:
    CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback();

    static void maybeDestroy(CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionLiftAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionLiftAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionLiftAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionLiftAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionLiftAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionLiftAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionTiltAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionTiltAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionTiltAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionTiltAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionTiltAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<uint16_t> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionTiltAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionLiftPercentageAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionTiltPercentageAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterTargetPositionLiftPercent100thsAttributeCallbackType>
{
public:
    CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent100ths> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterTargetPositionTiltPercent100thsAttributeCallbackType>
{
public:
    CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent100ths> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionLiftPercent100thsAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent100ths> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterCurrentPositionTiltPercent100thsAttributeCallbackType>
{
public:
    CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::Nullable<chip::Percent100ths> & value);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringServerGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterServerGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWindowCoveringServerGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringServerGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringServerGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringServerGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringServerGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringClientGeneratedCommandListAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterClientGeneratedCommandListAttributeCallbackType>
{
public:
    CHIPWindowCoveringClientGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringClientGeneratedCommandListAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringClientGeneratedCommandListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringClientGeneratedCommandListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringClientGeneratedCommandListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};

class CHIPWindowCoveringAttributeListAttributeCallback
    : public chip::Callback::Callback<CHIPWindowCoveringClusterAttributeListAttributeCallbackType>
{
public:
    CHIPWindowCoveringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false);

    ~CHIPWindowCoveringAttributeListAttributeCallback();

    static void maybeDestroy(CHIPWindowCoveringAttributeListAttributeCallback * callback)
    {
        if (!callback->keepAlive)
        {
            callback->Cancel();
            chip::Platform::Delete<CHIPWindowCoveringAttributeListAttributeCallback>(callback);
        }
    }

    static void CallbackFn(void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & list);
    static void OnSubscriptionEstablished(void * context)
    {
        CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(
            reinterpret_cast<CHIPWindowCoveringAttributeListAttributeCallback *>(context)->javaCallbackRef);
        VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err)));
    };

private:
    jobject javaCallbackRef;
    bool keepAlive;
};
